package com.huaxin.hxmodulesystem.models;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 组织实体类
 */
@Data
@TableName("organization")
public class Organization {

    /**
     * 唯一ID（UUID）- 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 自增序列号（唯一索引，非主键）
     */
    @TableField(value = "auto_id")
    private Integer autoId;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdAt;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updatedAt;

    /**
     * 更新人
     */
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 是否删除（0:未删, 1:已删）
     */
    @TableLogic
    @TableField(value = "is_deleted")
    private Integer isDeleted = 0;

    /**
     * 删除时间
     */
    @TableField(value = "deleted_at", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime deletedAt;

    /**
     * 删除人
     */
    @TableField(value = "deleted_by", fill = FieldFill.UPDATE)
    private String deletedBy;

    /**
     * 组织名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 组织代码
     */
    @TableField(value = "code")
    private String code;

    /**
     * 企业责任人电话
     */
    @TableField(value = "admin_tel")
    private String adminTel;

    /**
     * 企业责任人姓名
     */
    @TableField(value = "admin_real_name")
    private String adminRealName;

    /**
     * 上级组织ID
     */
    @TableField(value = "parent_id")
    private String parentId;

    /**
     * 区域
     */
    @TableField(value = "area")
    private String area;
    /**
     * 地址
     */
    @TableField(value = "address")
    private String address;
    /**
     * 经度
     */
    @TableField(value = "longitude")
    private String longitude;
    /**
     * 纬度
     */
    @TableField(value = "latitude")
    private String latitude;
    /**
     * 0-审核中；1-审核通过；2-审核失败
     */
    @TableField(value = "status")
    private Integer status;
    /**
     * 营业执照
     */
    @TableField(value = "business_license_image")
    private String businessLicenseImage;
    /**
     * 法人身份证-人物面
     */
    @TableField(value = "id_card_character")
    private String idCardCharacter;
    /**
     * 法人身份证-国徽面
     */
    @TableField(value = "id_card_national_emblem")
    private String idCardNationalEmblem;
    /**
     * 合同
     */
    @TableField(value = "contract")
    private String contract;

    //组织编码
    @TableField(value = "org_number")
    private String orgNumber;
}